Skip to content

fix: mock github checks in tests#724

Merged
frostebite merged 3 commits intomainfrom
fnkp48-codex/fix-fetch-implementation-issue-in-tests
Aug 6, 2025
Merged

fix: mock github checks in tests#724
frostebite merged 3 commits intomainfrom
fnkp48-codex/fix-fetch-implementation-issue-in-tests

Conversation

@frostebite
Copy link
Member

@frostebite frostebite commented Aug 3, 2025

Improving stability/fix for occasional fail on a test for coordinator/cloud runner.

Mocks a github check API which very occasionally fails.

Summary

  • polyfill fetch using undici for jest, loading it before test files
  • mock github check requests to avoid network dependency in tests
  • format cloud runner github checks test to satisfy prettier
  • always mock github check requests, removing debug guard
  • add optional github check integration test and parameterized workflow
  • rename GitHub checks integration test file to satisfy lint naming rules
  • document the GitHub checks integration test

Testing

  • npx prettier src/integration/cloud-runner-github-checks-integration-test.ts .github/workflows/cloud-runner-ci-pipeline.yml src/jest.setup.ts src/jest.globals.ts src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts jest.config.js --check
  • npx eslint src/**/*.ts (fails: ESLint couldn't find the @typescript-eslint/eslint-plugin package)
  • cloudRunnerTests=true yarn run test "cloud-runner-github-checks" --detectOpenHandles --forceExit --runInBand

https://chatgpt.com/codex/tasks/task_e_688e58da43948324b6030b044d3e3ec9

Summary by CodeRabbit

  • New Features

    • Added an optional manual workflow trigger to run GitHub integration tests.
    • Introduced a new integration test for Cloud Runner GitHub Checks.
  • Tests

    • Enhanced Jest configuration to support global setup files.
    • Added integration and unit tests for GitHub Checks functionality.
    • Improved test isolation by mocking GitHub API requests.
    • Added test helpers to streamline build parameter creation with overrides.
  • Chores

    • Polyfilled global fetch and related APIs using the undici library for test environments.

@coderabbitai
Copy link

coderabbitai bot commented Aug 3, 2025

📝 Walkthrough

Walkthrough

A new integration test for GitHub Checks was introduced, along with supporting configuration updates. The CI workflow now supports an optional manual job for running these integration tests. Jest configuration was updated to include a global setup file for polyfilling fetch with undici. Existing GitHub Checks tests were refactored to always run with mocked API calls. A new test helper module was added to facilitate parameter creation with overrides.

Changes

Cohort / File(s) Change Summary
CI Workflow Enhancements
.github/workflows/cloud-runner-ci-pipeline.yml
Added an optional runGithubIntegrationTests input for manual workflow dispatch. Introduced a conditional githubChecksIntegration job to run integration tests when triggered manually with the input flag.
Jest Configuration and Globals
jest.config.js, src/jest.globals.ts
Updated Jest config to include a new global setup file that polyfills fetch using undici. Added clarifying comments to Jest config.
Integration Test Addition
src/integration/cloud-runner-github-checks-integration-test.ts
Added a new integration test that creates and updates GitHub Checks via Cloud Runner, running only when an environment variable is set.
Unit Test Refactor
src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts
Refactored tests to always run with mocked GitHub API calls, ensuring isolation and no real network requests. Removed unused imports and added setup/teardown hooks for mocks.
Test Utilities Addition
src/test-utils/cloud-runner-test-helpers.ts
Added a helper module exporting an infinite timeout constant and an async function to create build parameters with optional CLI option overrides for testing.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant Integration Test
    participant GitHub API

    Developer->>GitHub Actions: Manually triggers workflow_dispatch with runGithubIntegrationTests=true
    GitHub Actions->>Integration Test: Starts githubChecksIntegration job
    Integration Test->>GitHub API: Creates GitHub check (real API call)
    Integration Test->>GitHub API: Updates GitHub check (real API call)
    Integration Test->>GitHub API: Updates GitHub check (real API call)
    Integration Test-->>GitHub Actions: Reports test results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐇
In the warren of code, a new path appears,
Integration tests hop in, allaying our fears.
With fetch now polyfilled and CI jobs anew,
Mocked checks keep things safe, no network to pursue.
The burrow’s more robust—cheers to this review!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 203ecf6 and 40757da.

📒 Files selected for processing (2)
  • jest.config.js (1 hunks)
  • src/test-utils/cloud-runner-test-helpers.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/test-utils/cloud-runner-test-helpers.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • jest.config.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: StandaloneOSX on 2023.2.2f1
  • GitHub Check: WebGL on 2022.3.13f1
  • GitHub Check: StandaloneLinux64 on 2023.2.2f1
  • GitHub Check: iOS on 2022.3.13f1
  • GitHub Check: Android on 2023.2.2f1
  • GitHub Check: StandaloneWindows64 on 2022.3.13f1
  • GitHub Check: WebGL on 2021.3.32f1
  • GitHub Check: Android on 2021.3.32f1
  • GitHub Check: iOS on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneOSX on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: Android on 2022.3.13f1
  • GitHub Check: Android on 2023.2.2f1
  • GitHub Check: StandaloneWindows64 on 2021.3.32f1
  • GitHub Check: tvOS on 2022.3.13f1
  • GitHub Check: WSAPlayer on 2023.2.2f1
  • GitHub Check: tvOS on 2021.3.32f1
  • GitHub Check: Android on 2021.3.32f1
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fnkp48-codex/fix-fetch-implementation-issue-in-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Aug 3, 2025

Cat Gif

@frostebite
Copy link
Member Author

#723 (comment)

Was unable to push to this branch with codex unfortunately, sorry had to recreate this time @cloudymax

Seems reasonable, but since my TS is not very strong I would need to ask:

  1. Why is it needed to disable certain eslint options?
  2. Could mocking the github return values lead to tests passing erroneously in the event a github API changes?

• Why is it needed to disable certain ESLint options? — The only disables are for camelcase where the GitHub API requires snake_case fields, so we suppress the camelCase rule around those API payload keys.

• Could mocking the GitHub return values lead to tests passing erroneously if the GitHub API changes? — Mocking keeps unit tests deterministic and offline. To catch breaking API changes, we added an optional integration test (RUN_GITHUB_INTEGRATION_TESTS) that exercises real GitHub checks, providing a safety net for API regressions.

@cloudymax

@frostebite frostebite requested a review from cloudymax August 3, 2025 23:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/jest.globals.ts (1)

1-3: LGTM with minor suggestions for TypeScript compatibility.

The fetch polyfill implementation is correct. The ESLint error about globalThis is a false positive - globalThis is a standard global object in Node.js 12+ and modern browsers.

Consider adding TypeScript declarations to improve type safety:

import { fetch as undiciFetch, Headers, Request, Response } from 'undici';

+declare global {
+  var fetch: typeof undiciFetch;
+  var Headers: typeof Headers;
+  var Request: typeof Request;
+  var Response: typeof Response;
+}
+
Object.assign(globalThis, { fetch: undiciFetch, Headers, Request, Response });
src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1)

18-33: LGTM! Good refactoring to mock GitHub API calls.

The addition of mocking in beforeEach/afterEach hooks properly isolates unit tests from external dependencies. This is the correct approach for unit testing.

Address the ESLint warning by simplifying the undefined return:

-    jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue(undefined);
+    jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e91ca9 and 259dcad.

📒 Files selected for processing (5)
  • .github/workflows/cloud-runner-ci-pipeline.yml (2 hunks)
  • jest.config.js (1 hunks)
  • src/integration/cloud-runner-github-checks-integration-test.ts (1 hunks)
  • src/jest.globals.ts (1 hunks)
  • src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: configure code analysis tools to recognize typescript files to ensure accurate detection of properti...
Learnt from: ejnarvala
PR: game-ci/unity-builder#661
File: src/model/platform-setup.ts:35-35
Timestamp: 2024-10-25T18:45:10.112Z
Learning: Configure code analysis tools to recognize TypeScript files to ensure accurate detection of properties like `unityLicensingProductIds` in future reviews.

Applied to files:

  • jest.config.js
📚 Learning: the build steps duplication in the workflow is intentional to implement a retry mechanism with diffe...
Learnt from: MichaelBuhler
PR: game-ci/unity-builder#685
File: .github/workflows/build-tests-ubuntu.yml:146-146
Timestamp: 2025-01-30T18:01:50.339Z
Learning: The build steps duplication in the workflow is intentional to implement a retry mechanism with different delay intervals between attempts.

Applied to files:

  • .github/workflows/cloud-runner-ci-pipeline.yml
🧬 Code Graph Analysis (1)
src/integration/cloud-runner-github-checks-integration-test.ts (3)
src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1)
  • TIMEOUT_INFINITE (8-8)
src/model/cli/cli.ts (1)
  • Cli (16-175)
src/model/unity-versioning.ts (1)
  • UnityVersioning (4-32)
🪛 ESLint
src/jest.globals.ts

[error] 3-3: 'globalThis' is not defined.

(no-undef)

src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts

[error] 28-28: Do not use useless undefined.

(unicorn/no-useless-undefined)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: StandaloneLinux64 on 2023.2.2f1
  • GitHub Check: WebGL on 6000.0.36f1 (via Build Profile)
  • GitHub Check: WebGL on 2022.3.13f1
  • GitHub Check: StandaloneWindows64 on 2023.2.2f1
  • GitHub Check: Android on 2023.2.2f1
  • GitHub Check: iOS on 2023.2.2f1
  • GitHub Check: StandaloneLinux64 on 2023.2.2f1
  • GitHub Check: Android on 2022.3.13f1
  • GitHub Check: WebGL on 2023.2.2f1
  • GitHub Check: StandaloneLinux64 on 2022.3.13f1
  • GitHub Check: StandaloneWindows64 on 2022.3.13f1
  • GitHub Check: StandaloneWindows64 on 2022.3.13f1
  • GitHub Check: StandaloneLinux64 on 2022.3.13f1
  • GitHub Check: WebGL on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneOSX on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneWindows64 on 2021.3.32f1
  • GitHub Check: Tests
🔇 Additional comments (7)
jest.config.js (1)

28-32: LGTM! Clean Jest configuration update.

The addition of setupFiles to load the fetch polyfill before each test file is correct, and the updated comments clearly distinguish between setupFiles and setupFilesAfterEnv.

src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1)

35-72: LGTM! Tests properly exercise both direct and async GitHub check workflows.

The tests correctly cover both direct GitHub check creation/updates and async workflow scenarios. The infinite timeout is appropriate for integration-style tests that may take time to complete.

src/integration/cloud-runner-github-checks-integration-test.ts (3)

17-19: LGTM! Clean conditional test execution pattern.

The use of describeOrSkip based on the environment variable is a clean way to conditionally run integration tests.


32-38: LGTM! Integration test properly exercises real GitHub API calls.

The test correctly creates and updates GitHub checks with realistic scenarios, including proper assertions and status transitions.


24-31: Test project directory and version file verified
Confirmed that test-project and test-project/ProjectSettings/ProjectVersion.txt both exist in the CI environment and contain a valid Unity editor version. No further changes are needed.

.github/workflows/cloud-runner-ci-pipeline.yml (2)

6-10: LGTM! Clean workflow input parameter for optional integration tests.

The addition of runGithubIntegrationTests input with proper defaults and description follows GitHub Actions best practices.


216-231: LGTM! Well-structured conditional integration test job.

The job correctly:

  • Runs only on manual workflow dispatch when explicitly requested
  • Sets appropriate environment variables
  • Uses proper Node.js setup with caching
  • Runs tests with appropriate Jest flags for integration testing
  • Passes required secrets

Comment on lines +9 to +15
export const TIMEOUT_INFINITE = 1e9;

async function createParameters(overrides?: OptionValues) {
if (overrides) Cli.options = overrides;

return BuildParameters.create();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Address code duplication with the unit test file.

Both TIMEOUT_INFINITE and createParameters are duplicated from src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts. Consider extracting these to a shared test utilities module.

Create a shared utilities file like src/test-utils/cloud-runner-test-helpers.ts:

import { BuildParameters } from '../model';
import { Cli } from '../model/cli/cli';
import { OptionValues } from 'commander';

export const TIMEOUT_INFINITE = 1e9;

export async function createParameters(overrides?: OptionValues) {
  if (overrides) Cli.options = overrides;
  return BuildParameters.create();
}

Then import from both test files.

🤖 Prompt for AI Agents
In src/integration/cloud-runner-github-checks-integration-test.ts around lines 9
to 15, the constants TIMEOUT_INFINITE and the function createParameters are
duplicated from another test file. To fix this, extract both into a new shared
test utility module, for example src/test-utils/cloud-runner-test-helpers.ts,
and move the definitions there. Then update this test file and the other test
file to import TIMEOUT_INFINITE and createParameters from the new shared module
instead of defining them locally.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/test-utils/cloud-runner-test-helpers.ts (1)

9-9: Add blank line before return statement.

ESLint requires a blank line before the return statement for better readability.

   if (overrides) Cli.options = overrides;
+
   return BuildParameters.create();
src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1)

20-20: Remove unnecessary undefined value.

ESLint flags the explicit undefined as unnecessary since mockResolvedValue() without arguments defaults to undefined.

-    jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue(undefined);
+    jest.spyOn(GitHub as any, 'runUpdateAsyncChecksWorkflow').mockResolvedValue();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 259dcad and 203ecf6.

📒 Files selected for processing (4)
  • jest.config.js (1 hunks)
  • src/integration/cloud-runner-github-checks-integration-test.ts (1 hunks)
  • src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (1 hunks)
  • src/test-utils/cloud-runner-test-helpers.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • jest.config.js
  • src/integration/cloud-runner-github-checks-integration-test.ts
🧰 Additional context used
🪛 ESLint
src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts

[error] 20-20: Do not use useless undefined.

(unicorn/no-useless-undefined)

src/test-utils/cloud-runner-test-helpers.ts

[error] 9-9: Expected blank line before this statement.

(padding-line-between-statements)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: StandaloneOSX on 2022.3.13f1
  • GitHub Check: StandaloneLinux64 on 2022.3.13f1
  • GitHub Check: StandaloneOSX on 2023.2.2f1
  • GitHub Check: StandaloneOSX on 2022.3.13f1
  • GitHub Check: iOS on 2022.3.13f1
  • GitHub Check: StandaloneOSX on 2021.3.45f1
  • GitHub Check: iOS on 2021.3.45f1
  • GitHub Check: iOS on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneWindows64 on 2021.3.32f1
  • GitHub Check: StandaloneLinux64 on 2021.3.32f1
  • GitHub Check: StandaloneOSX on 2021.3.32f1
  • GitHub Check: StandaloneWindows64 on 2021.3.32f1
  • GitHub Check: WSAPlayer on 2023.2.2f1
  • GitHub Check: StandaloneWindows64 on 2022.3.13f1
  • GitHub Check: tvOS on 2023.2.2f1
  • GitHub Check: Android on 2023.2.2f1
  • GitHub Check: tvOS on 2021.3.32f1
  • GitHub Check: Android on 2022.3.13f1
  • GitHub Check: Android on 2021.3.32f1
🔇 Additional comments (4)
src/test-utils/cloud-runner-test-helpers.ts (1)

5-5: LGTM!

The TIMEOUT_INFINITE constant provides a clear, reusable timeout value for long-running tests.

src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts (3)

10-25: Excellent mocking strategy for test isolation.

The beforeEach/afterEach pattern properly isolates tests from external GitHub API dependencies while ensuring clean state between tests. This aligns perfectly with the PR objective of improving test reliability.


31-37: LGTM on parameter setup standardization.

Using the shared createParameters helper improves consistency across tests and eliminates code duplication. The parameter configuration properly enables GitHub checks and async workflow for testing.

Also applies to: 49-55


27-44: Well-structured test cases with appropriate timeout.

Both test cases follow a clear pattern:

  1. Setup parameters with required configuration
  2. Initialize CloudRunner
  3. Exercise GitHub check creation and updates
  4. Use infinite timeout for potentially long-running operations

The tests effectively validate both direct and async workflow scenarios as intended.

Also applies to: 45-64

Comment on lines +7 to +10
export async function createParameters(overrides?: OptionValues) {
if (overrides) Cli.options = overrides;
return BuildParameters.create();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider test isolation concerns with global state mutation.

The function modifies Cli.options globally without cleanup, which could cause test isolation issues if multiple tests run concurrently or if a test fails before cleanup.

Consider one of these approaches:

  1. Return a cleanup function or use try/finally
  2. Store the original options and restore them
  3. Make the function more explicit about its side effects
 export async function createParameters(overrides?: OptionValues) {
+  const originalOptions = Cli.options;
   if (overrides) Cli.options = overrides;
-  return BuildParameters.create();
+  try {
+    return await BuildParameters.create();
+  } finally {
+    Cli.options = originalOptions;
+  }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export async function createParameters(overrides?: OptionValues) {
if (overrides) Cli.options = overrides;
return BuildParameters.create();
}
export async function createParameters(overrides?: OptionValues) {
const originalOptions = Cli.options;
if (overrides) Cli.options = overrides;
try {
return await BuildParameters.create();
} finally {
Cli.options = originalOptions;
}
}
🧰 Tools
🪛 ESLint

[error] 9-9: Expected blank line before this statement.

(padding-line-between-statements)

🤖 Prompt for AI Agents
In src/test-utils/cloud-runner-test-helpers.ts around lines 7 to 10, the
function createParameters modifies the global Cli.options without restoring it,
risking test isolation issues. To fix this, store the original Cli.options value
before overwriting it, then restore the original value after
BuildParameters.create() completes, using a try/finally block or returning a
cleanup function to ensure the global state is reset regardless of test
outcomes.

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.34%. Comparing base (9e91ca9) to head (40757da).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #724      +/-   ##
==========================================
+ Coverage   37.05%   38.34%   +1.28%     
==========================================
  Files          77       78       +1     
  Lines        3163     3169       +6     
  Branches      626      663      +37     
==========================================
+ Hits         1172     1215      +43     
+ Misses       1991     1809     -182     
- Partials        0      145     +145     
Files with missing lines Coverage Δ
src/test-utils/cloud-runner-test-helpers.ts 100.00% <100.00%> (ø)

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@frostebite frostebite merged commit c6c8236 into main Aug 6, 2025
59 checks passed
@frostebite frostebite deleted the fnkp48-codex/fix-fetch-implementation-issue-in-tests branch August 6, 2025 05:07
@webbertakken
Copy link
Member

Released in v4.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants